<%inherit file="/dashboard/site.mako" />
<%def name="title()">Dashboard</%def>
<%
	def print_list_programmations(programmations_db):	
		all_programmations = ''
		
		for programmation in programmations_db:
			tr = '<tr>'
			tr = tr + '<td>'+str(programmation)+'</td>'
			tr = tr + '<td>' + str(programmation.title)[:50] + '</td>'
			tr = tr + '<td><a href="/dashboard/del_programmation/' + str(programmation.id) + '" onclick="return user_confirm();">Supprimer</a></td>'
			tr = tr + '</tr>'
			all_programmations = all_programmations + tr

		return all_programmations
%>
<div style="padding: 20px;">
	<div>
	${c.message | n}
	%if request.params.get('deleted') == 'yes':
		<span class='success_message'>La programmation a ete correctement supprimee</span>
	%elif request.params.get('deleted') == 'no':
		<span class='error_message'>La programmation n'a pas ete supprimee - veulliez signaler l'incident au webmaster s'il vous plais</span>
	%endif
	</div>
	<p>Modifer une programmation</p>
	<table style="font-size: 12px;">
		<tr style="background: grey; color: white;"><td>ID</td><td style="width: 300px;">Nom</td><td></td></tr>		
		
		${print_list_programmations(c.programmations) | n}
		
	</table>
</div>
